﻿/*
*仓库可视化
*
*CreateBy:   Black
*
*CreateDate: 2009-11-6
*
/*--------------------------------------------------------------------------*/
 var xmlhttp;
//创建浏览器对象
function createXMLHttpRequest() 
{                 
    if (window.XMLHttpRequest) 
    { 
         xmlhttp = new XMLHttpRequest(); 
        if (xmlhttp.overrideMimeType) 
        { 
            xmlhttp.overrideMimeType("text/xml"); 
        } 
    } 
    else if (window.ActiveXObject) 
    { 
        var activexName = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP"]; 
        for (var i = 0; i < activexName.length; i++) 
        { 
            try
            { 
                xmlhttp = new ActiveXObject(activexName[i]); 
                break; 
            } 
            catch(e)
            { 
            } 
        } 
    } 
}

//仓库加载
function WareHouseLoad(value)
{         
  var ShowEffect;       
   if(document.getElementById('RadioPane').checked == true)
   {
   ShowEffect = "Pane";
   }
   if(document.getElementById('RadioSilid').checked ==true)
   {
   ShowEffect = "Solid";
   }

   var Url = "../Common/LocationShowAjax.aspx?TYPE=" + value + "&LocationID=" + escape(document.getElementById("hdnDetailID").value) + "&ShowEffect=" + ShowEffect + "&HistoryData=" + document.getElementById('chkHistory').checked + "&QueryLocID=" + document.getElementById('txtSelectLocID').value + "&QueryStatus=" + document.getElementById('QueryddlStatus').value + "&QuerySkuID=" + escape(document.getElementById('txtSelectSkuID').value) + "&QueryZoneID=" + escape(document.getElementById('txtSelectZoneID').value) + "&ram=" + Math.round(Math.random() * 100) + "&QueryOwnerID=" + escape(document.getElementById('txtOwnerID').value) + "&QueryLot=" + document.getElementById('txtLot').value + "&QueryLpn=" + document.getElementById('txtLpn').value;
    createXMLHttpRequest();                    
    xmlhttp.onreadystatechange = WareHousehandleStateChange;
    xmlhttp.open("GET", Url, true);
    xmlhttp.send(null);

}
//返回数据
function WareHousehandleStateChange()
{   
    if (xmlhttp.readyState == 4) 
    {
        if (xmlhttp.status == 200) 
        {
          var data =xmlhttp.responseText;
          data = data.split('@_@');
          switch(data[0])
          {
            case "Location":
            document.getElementById("div_arealine").innerHTML=data[1];
            document.getElementById("DivLoctionShow").innerHTML =data[2];
            $.unblockUI();         
           break;
          case "SkuDetail":
           document.getElementById("LocShow").innerHTML = data[1];
           document.getElementById("LocShow").style.display = "block";
           break;
            
//            case "LocationDetail":
//               document.getElementById("LocDetailDiv").innerHTML=data[1];
//               document.getElementById("LocDetailDiv").style.display = "block";
//            break;
           
//            case "Query":
//             document.getElementById("div_arealine").innerHTML=data[1];
//             document.getElementById("DivLoctionShow").innerHTML =data[2];                  
//             LocQueryShow();
//            break;
            
          }    
        }
    }
}